<template>
  <div>
    <x-header id="header" :left-options="{backText: ''}">我的团队</x-header>
    <div class="main-header">
      <div class="team-superior">
        <div class="team-title">我的团长</div>
        <div class="team-con">
          <div class="team-name">{{leaderName || '暂无'}}</div>
        </div>
      </div>
      <div class="team-subordinateList">
        <group class="team-group" title="我的团员">
          <cell class="team-cell" v-for="(item,index) in subordinateList" :key="index" :title="item.name" :link="`teamTeam?id=${item.id}`"  >
          </cell>
        </group>
      </div>
    </div>
  </div>
</template>

<script>
import { getTeam } from '@/api/user'
export default {
  name: 'team',
  data () {
    return {
      subordinateList: [],
      leaderName: ''
    }
  },
  mounted () {
    console.log(this.globalData)
    getTeam(this.globalData.cid).then(data => {
      this.subordinateList = data.item
      this.leaderName = data.name
      this.leaderId = data.id
    })
  }
}
</script>

<style scoped>

</style>
